package com.service;
import java.util.List;
import com.model.Renwu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import com.mapper.RenwuMapper;
@Service
public class RenwuServiceImpl implements RenwuService
{
        
        @Autowired
	private RenwuMapper renwuMapper;


	public List<Renwu> queryRenwuList(Renwu renwu) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		if(renwu!=null){
			 map.put("zid", renwu.getZid());
		}
		
		List<Renwu> getRenwu = renwuMapper.query(map);
		return getRenwu;
	}

	public int insertRenwu(Renwu renwu) throws Exception {
		
		return renwuMapper.insertRenwu(renwu);
	}

	public int deleteRenwu(int id) throws Exception {
		return renwuMapper.deleteRenwu(id);
	}

	public int updateRenwu(Renwu renwu) throws Exception {
		return renwuMapper.updateRenwu(renwu);
	}
	
	public Renwu queryRenwuById(int id) throws Exception {
		return renwuMapper.queryRenwuById(id);
	}
 
}
